package tools;
import static tools.print.*;

import java.util.HashSet;
import java.util.Set;

public class Main {
	public static void main(String[] args)
	{

			String s ="0100110001010001";
			Set<String> set = new HashSet<String>();
			for (int i = 0; i < s.length(); i++) {
				for (int j = i+1; j <= s.length(); j++) {
					String a = s.substring(i,j);
					set.add(a);
				}
			}
			System.out.println(set.size());
		
	}
}
